﻿@model BookShop3Tables.Models.Category

@{
    ViewBag.Title = "Details";
}

<h2>Details</h2>

<fieldset>
    <legend>Category</legend>

    <div class="display-label">Name</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Name)
    </div>
    <div class="display-field">
        <table>
            <tr>
                <th>
                    Book Title
                </th>
                <th>
                    Series Name
                </th>
            </tr>
            @foreach (var item in Model.Books)
            {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.Name)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.Saga)
                    </td>
            </tr>
            }
        </table>
    </div>
</fieldset>
<p>
    @Html.ActionLink("Edit", "Edit", new { id=Model.CategoryID }) |
    @Html.ActionLink("Back to List", "Index")
</p>
